package cn.maihe.elg.operation.repository.entity;

import cn.maihe.framework.starter.mybatis.mapper.Fn;
import cn.maihe.framework.starter.mybatis.mapper.PlusEntityWrapper;

public final class RolePermissionDOCondition {
    private PlusEntityWrapper<RolePermissionDO> ew;

    public RolePermissionDOCondition() {
        this.ew = new PlusEntityWrapper(RolePermissionDO.class);
    }

    public static RolePermissionDOCondition builder() {
        return new RolePermissionDOCondition();
    }

    public PlusEntityWrapper<RolePermissionDO> build() {
        return this.ew;
    }

    public RolePermissionDOCondition or() {
        this.ew.orNew();
        return this;
    }

    public RolePermissionDOCondition and() {
        this.ew.andNew();
        return this;
    }

    private boolean isAndOr() {
        return ew.originalSql() == null || "".equals(ew.originalSql()) ? true : ew.originalSql().endsWith("AND ()") || ew.originalSql().endsWith("OR ()");
    }

    public void clear() {
        this.ew = null;
        this.ew = new PlusEntityWrapper(RolePermissionDO.class);
    }

    public RolePermissionDOCondition setSqlSelect(String sqlStr) {
        ew.setSqlSelect(sqlStr);
        return this;
    }

    public RolePermissionDOCondition orderAsc(String column) {
        ew.orderBy(true, column, true);
        return this;
    }

    public RolePermissionDOCondition orderDesc(String column) {
        ew.orderBy(true, column, false);
        return this;
    }

    public RolePermissionDOCondition groupBy(String column) {
        ew.groupBy(column);
        return this;
    }

    public <E, R> RolePermissionDOCondition orderAsc(Fn<E, R> fn) {
        ew.orderAsc(fn);
        return this;
    }

    public <E, R> RolePermissionDOCondition orderDesc(Fn<E, R> fn) {
        ew.orderDesc(fn);
        return this;
    }

    public <E, R> RolePermissionDOCondition groupBy(Fn<E, R> fn) {
        ew.groupBy(fn);
        return this;
    }

    public RolePermissionDOCondition exists(String sqlStr) {
        ew.exists(sqlStr);
        return this;
    }

    public RolePermissionDOCondition notExists(String sqlStr) {
        ew.notExists(sqlStr);
        return this;
    }

    public RolePermissionDOCondition having(String sqlStr, Object... params) {
        ew.having(sqlStr, params);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdIsNull() {
        ew.isNull("permission_id");
        return this;
    }

    public RolePermissionDOCondition orPermissionIdIsNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNull("permission_id");
        return this;
    }

    public RolePermissionDOCondition andPermissionIdIsNotNull() {
        ew.isNotNull("permission_id");
        return this;
    }

    public RolePermissionDOCondition orPermissionIdIsNotNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNotNull("permission_id");
        return this;
    }

    public RolePermissionDOCondition andPermissionIdEq(Object value) {
        ew.eq("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdEq(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.eq("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdNe(Object value) {
        ew.ne("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdNe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ne("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdGt(Object value) {
        ew.gt("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdGt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.gt("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdGe(Object value) {
        ew.ge("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdGe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ge("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdLt(Object value) {
        ew.lt("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdLt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.lt("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdLe(Object value) {
        ew.le("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdLe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.le("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdIn(Object... value) {
        ew.in("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.in("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdNotIn(Object... value) {
        ew.notIn("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdNotIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notIn("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdBetween(Object value, Object value1) {
        ew.between("permission_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.between("permission_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdNotBetween(Object value, Object value1) {
        ew.notBetween("permission_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdNotBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notBetween("permission_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdLike(String value) {
        ew.like("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.like("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andPermissionIdNotLike(String value) {
        ew.notLike("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition orPermissionIdNotLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notLike("permission_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdIsNull() {
        ew.isNull("role_id");
        return this;
    }

    public RolePermissionDOCondition orRoleIdIsNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNull("role_id");
        return this;
    }

    public RolePermissionDOCondition andRoleIdIsNotNull() {
        ew.isNotNull("role_id");
        return this;
    }

    public RolePermissionDOCondition orRoleIdIsNotNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNotNull("role_id");
        return this;
    }

    public RolePermissionDOCondition andRoleIdEq(Object value) {
        ew.eq("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdEq(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.eq("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdNe(Object value) {
        ew.ne("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdNe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ne("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdGt(Object value) {
        ew.gt("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdGt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.gt("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdGe(Object value) {
        ew.ge("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdGe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ge("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdLt(Object value) {
        ew.lt("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdLt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.lt("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdLe(Object value) {
        ew.le("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdLe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.le("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdIn(Object... value) {
        ew.in("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.in("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdNotIn(Object... value) {
        ew.notIn("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdNotIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notIn("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdBetween(Object value, Object value1) {
        ew.between("role_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition orRoleIdBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.between("role_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition andRoleIdNotBetween(Object value, Object value1) {
        ew.notBetween("role_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition orRoleIdNotBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notBetween("role_id", value, value1);
        return this;
    }

    public RolePermissionDOCondition andRoleIdLike(String value) {
        ew.like("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.like("role_id", value);
        return this;
    }

    public RolePermissionDOCondition andRoleIdNotLike(String value) {
        ew.notLike("role_id", value);
        return this;
    }

    public RolePermissionDOCondition orRoleIdNotLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notLike("role_id", value);
        return this;
    }
}
